package dna.markpim;

public class Node implements Comparable<Node>{

	private char ch;
	private int freq;
	private Node left, right;
	//size van het extended ASCII alfabet 
	private final int maxChar = 256;
	
	public Node(char ch, int freq, Node left, Node right) {
		this.ch = ch;
		this.freq = freq;
		this.left = left;
		this.right = right;
	}
	
	private boolean isBlad() {
		return left == null && right == null;
	}

	@Override
	public int compareTo(Node n) {
		return freq - n.freq;
	}
	
	private int[] countFreq(String s) {
		int freq[] = new int[maxChar];
		for(int i = 0; i < s.length(); i++) {
			freq[s.charAt(i)]++;
		}
		return freq;
	}
	
	private Node buildTrie(String s) {
		char[] input = s.toCharArray();
		int[] freq = countFreq(s);
		
		
		return null;
	}
}
